package com.financing.platform.dao.impl;



import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IProjectCompanyDao;
import com.financing.platform.dto.ProjectCompanyDTO;
import com.financing.platform.util.SqlName;
@SuppressWarnings("unchecked")
@Repository("projectCompanyDaoImpl")
public class ProjectCompanyDaoImpl extends BaseDaoImpl 
		implements IProjectCompanyDao { 


	@Override
	public List<ProjectCompanyDTO> getProjectCompanyList(
			ProjectCompanyDTO projectCompanyDTO) throws SQLException {
		return (List<ProjectCompanyDTO>)this.sqlMapClient.queryForList(SqlName.queryProjectCompany, projectCompanyDTO);
	}

	@Override
	public ProjectCompanyDTO getProjectCompanyById(int productCompanyId)
			throws SQLException {
		return (ProjectCompanyDTO) this.sqlMapClient.queryForObject(SqlName.queryProjectCompanyInfo, productCompanyId);
	}

	@Override
	public int updateProjectCompany(ProjectCompanyDTO projectCompanyDTO)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updateProjectCompany, projectCompanyDTO);
	}

	@Override
	public int addProjectCompany(ProjectCompanyDTO projectCompanyDTO)
			throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addProjectCompany, projectCompanyDTO);
	}
	@Override
	public int queryProjectCompanyCount(ProjectCompanyDTO projectCompanyDTO) throws SQLException {
		return (Integer)this.sqlMapClient.queryForObject(SqlName.queryProjectCompanyCount, projectCompanyDTO);
	}

	@Override
	public int delProjectCompany(int productCompanyId) throws SQLException {
		return this.sqlMapClient.delete(SqlName.delProjectCompany, productCompanyId);
	}

}
